<?php 

//练习,js里面构造函数怎么去写,当实例化对象的时候自动执行
class student{
    private $name;
    private $age;
    //初始化成员变量
public function __construct($name,$age)
{
    $this->name=$name;
    $this->age=$age;
}
//显示
public function show(){
    echo $this->age;
    echo $this->age;
}


}
$stu=new student('张三',10);
$stu->show();

?>


